<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="keywords" Content="niceit,andre">
    <meta name="description" content="niceit.top">
    <title>Index - niceit</title>
    <style>
        .copy-right {
            text-align: center;
        }

        .wellcome {
            font-size: 46px;
            display: block;
            text-align: center;
        }

        table {
            width: 100%;
            margin-top: 20px;
            margin-bottom: 40px;
        }

        table th,
        table td {
            text-align: left;
        }

        table thead th {
            font-size: 24px;
        }

        table tbody td {
            font-size: 18px;
        }
    </style>
</head>

<body>
    <div>
        <span class="wellcome">Welcome NiceIT.top</span>
        <table border="1">
            <tbody>
                {% for item in list %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ item.title }}</td>
                    <td>
                        <a href="{{ item.url }}" target="_blank" id="url_{{ loop.index }}">{{ item.url }}</a>
                        &nbsp;&nbsp;
                        <a href="javascript:;" class="copy" data-clipboard-target="#url_{{ loop.index }}">复制链接</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="copy-right">
        <span>© 2017</span>
        &nbsp;
        <span>niceit.top</span>
        &nbsp;
        <a href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备16019513号-1</a>
    </div>
</body>

<script src="/static/scripts/jquery.slim.min.js"></script>
<script src="/static/scripts/clipboard.min.js"></script>
<script>
    $(function () {
        (function () {
            var clipboard = new ClipboardJS('.copy');
            clipboard.on('success', function (e) {
                // console.info('Action:', e.action);
                // console.info('Text:', e.text);
                // console.info('Trigger:', e.trigger);
                e.clearSelection();
                alert('复制成功');
            });
            clipboard.on('error', function (e) {
                // console.error('Action:', e.action);
                // console.error('Trigger:', e.trigger);
                alert('复制错误');
            });
        })();
    });
</script>

</html>